package com.hsurosy.domain.activity.service.quota;

import com.hsurosy.domain.activity.model.entity.ActivityCountEntity;
import com.hsurosy.domain.activity.model.entity.ActivityEntity;
import com.hsurosy.domain.activity.model.entity.ActivitySkuEntity;
import com.hsurosy.domain.activity.repository.IActivityRepository;
import com.hsurosy.domain.activity.service.quota.rule.factory.DefaultActivityChainFactory;

/**
 * @Author Hsu琛君珩
 * @Date 2024-11-08 17:59
 * @Description 抽奖活动的支撑类
 * @Version: v1.0.0
 */
public class RaffleActivityAccountQuotaSupport {

    protected DefaultActivityChainFactory defaultActivityChainFactory; // 活动规则链工厂
    protected IActivityRepository activityRepository; // 活动仓储接口

    public RaffleActivityAccountQuotaSupport(DefaultActivityChainFactory defaultActivityChainFactory, IActivityRepository activityRepository) {
        this.defaultActivityChainFactory = defaultActivityChainFactory;
        this.activityRepository = activityRepository;
    }

    /**
     * 查询活动SKU信息
     *
     * @param sku SKU编号
     * @return 活动SKU实体
     */
    public ActivitySkuEntity queryActivitySku(Long sku) {
        return activityRepository.queryActivitySku(sku);
    }

    /**
     * 根据活动ID查询活动基本信息
     *
     * @param activityId 活动ID
     * @return 活动实体对象
     */
    public ActivityEntity queryRaffleActivityByActivityId(Long activityId) {
        return activityRepository.queryRaffleActivityByActivityId(activityId);
    }

    /**
     * 根据活动次数ID查询用户的活动参与次数信息
     *
     * @param activityCountId 活动次数ID
     * @return 活动次数实体对象
     */
    public ActivityCountEntity queryRaffleActivityCountByActivityCountId(Long activityCountId) {
        return activityRepository.queryRaffleActivityCountByActivityCountId(activityCountId);
    }

}
